package de.widas.gaesf.web;

import org.apache.wicket.Application;
import org.apache.wicket.Response;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.protocol.http.WebRequest;
import org.apache.wicket.protocol.http.WebRequestCycle;
import org.apache.wicket.util.watch.IModificationWatcher;

/**
 * Created on: 24.09.2009, 15:48:12<br/>
 * Copyright 2009 by WidasConcepts GmbH<br/>
 * 
 * @author Meykel Gruel
 */
public class GAEWebRequestCycle extends WebRequestCycle {

	/**
	 * @param pApplication
	 * @param pRequest
	 * @param pResponse
	 */
	public GAEWebRequestCycle(WebApplication pApplication, WebRequest pRequest, Response pResponse) {
		super(pApplication, pRequest, pResponse);
	}

	/** Calls custom {@link IModificationWatcher}. */
	@Override
	protected void onBeginRequest() {
		if (getApplication().getConfigurationType() == Application.DEVELOPMENT) {
			GAEModificationWatcher resourceWatcher = (GAEModificationWatcher) getApplication().getResourceSettings().getResourceWatcher(true);
			resourceWatcher.checkResources();
		}
	}
}
